import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //读取要加到n!
        int n = sc.nextInt();
        int s = sum(n);
        System.out.println(s);
    }
    //求阶乘和的函数
    public static int sum(int n){
        int ret = 1;
        int Sum = 0;
        for(int i = 1; i <= n; i++){
            ret *= i;
            Sum += ret;
        }
        return Sum;
    }
}
